package org.znxs.znxsojquestion.services;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.znxs.model.model.dto.questionsubmit.QuestionSubmitAddRequest;
import org.znxs.model.model.dto.questionsubmit.QuestionSubmitQueryRequest;
import org.znxs.model.model.entity.QuestionSubmit;
import org.znxs.model.model.entity.User;
import org.znxs.model.model.vo.QuestionSubmitVO;

/**
 * @author administer
 * @description 针对表【question_submit(题目提交记录)】的数据库操作Service
 * @createDate 2024-11-10 17:48:06
 */
public interface QuestionSubmitService extends IService<QuestionSubmit> {

    /**
     * 题目提交
     *
     * @param questionSubmitAddRequest
     * @param loginUser
     * @return
     */
    Long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, User loginUser);

    /**
     * 事务 （后面再处理）
     *
     * @param userId
     * @param postId
     * @return
     */
    int doQuestionSubmitInner(long userId, long postId);

    /**
     * 获取查询条件
     *
     * @param questionSubmitQueryRequest
     * @return
     */
    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitQueryRequest questionSubmitQueryRequest);


    /**
     * 获取提交题目封装
     *
     * @param questionSubmit
     * @param currentUser    当前登录用户
     * @return
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit questionSubmit, User currentUser);

    /**
     * 分页获取提交题目封装
     *
     * @param questionSubmitPage
     * @param currentUser
     * @return
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionSubmitPage, User currentUser);


}
